<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN"
  "http://colorer.sf.net/2003/hrc.dtd"[
<!ENTITY kw        SYSTEM "ruby.kw.ent.hrc">
<!ENTITY kw-class  SYSTEM "ruby.kw-class.ent.hrc">
]>
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd">

  <type name="ruby">
    <annotation>
      <documentation><![CDATA[
        Ruby syntax
      ]]></documentation>
      <contributors><![CDATA[
        Vic Zus <vvitiok@yahoo.com>
        Igor Russkih
      ]]></contributors>
    </annotation>

    <region name="String" parent="def:String"/>
    <region name="Comment" parent="def:Comment"/>
    <region name="CommentDoc" parent="def:CommentDoc"/>

    <region name="Parameter" parent="def:Parameter"/>
    <region name="Keyword" parent="def:Keyword"/>
    <region name="Number" parent="def:Number"/>

    <region name="ClassOutline" parent="def:Outlined"/>
    <region name="AliasOutline" parent="def:Outlined"/>
    <region name="MethodOutline" parent="def:Outlined"/>
    

    <scheme name="String">
      <regexp match="/\\./"/>
    </scheme>

    <scheme name="InterpolatedString">
      <block start='/\#\{/' end='/\}/' scheme="ruby" region='def:Insertion' region00='def:PairStart' region10='def:PairEnd'/>
      <regexp match="/\\./"/>
    </scheme>
    
    <scheme name="InterpolatedString1">
      <block start='/\{/' end='/\}/' scheme="InterpolatedString1" region='String'/>
      <inherit scheme="InterpolatedString"/>
    </scheme>

    <scheme name="InterpolatedString2">
      <block start='/\[/' end='/\]/' scheme="InterpolatedString2" region='String'/>
      <inherit scheme="InterpolatedString"/>
    </scheme>

    <scheme name="InterpolatedString3">
      <block start='/\(/' end='/\)/' scheme="InterpolatedString3" region='String'/>
      <inherit scheme="InterpolatedString"/>
    </scheme>
    <scheme name="InterpolatedString4">
      <block start='/\&lt;/' end='/\&gt;/' scheme="InterpolatedString4" region='String'/>
      <inherit scheme="InterpolatedString"/>
    </scheme>

    <scheme name="Strings">
      <block start='/([\x27])/' end='/\y1/' scheme="String" region='String'/>
      <block start='/\%[qxw](\{)/' end='/\}/' scheme="String" region='String'/>
      <block start='/\%[qxw](\[)/' end='/\]/' scheme="String" region='String'/>
      <block start='/\%[qxw](\()/' end='/\)/' scheme="String" region='String'/>
      <block start='/\%[qxw](.)/' end='/\y1/' scheme="String" region='String'/>

      <block start='/\%[QW](\{)/' end='/\}/' scheme="InterpolatedString1" region='String'/>
      <block start='/\%[QW](\[)/' end='/\]/' scheme="InterpolatedString2" region='String'/>
      <block start='/\%[QW](\()/' end='/\)/' scheme="InterpolatedString3" region='String'/>
      <block start='/\%[QW]?(\&lt;)/' end='/\&gt;/' scheme="InterpolatedString4" region='String'/>
      <block start='/\%[QW](.)/' end='/\y1/' scheme="InterpolatedString" region='String'/>

      <block start='/&lt;&lt;(\-?)([&apos;]?)([\w_]+)\2/' end='/\y3/' scheme="InterpolatedString"
             region='String' region03='def:PairStart' region10='def:PairEnd'/>

      <block start='/([\x22\`])/' end='/\y1/' scheme="InterpolatedString" region='String'/>
      <block start='/\%(\()/' end='/\)/' scheme="InterpolatedString" region='String'/>
    </scheme>

    <scheme name="ruby">

      <block start='/\#/' end='/$/' scheme='def:Comment' region='Comment'/>
      <block start='/^=begin/' end='/^=end/' scheme='def:Comment' region='CommentDoc'/>

      <inherit scheme="def:Number"/>

      <inherit scheme='Strings'/>

      <!-- stolen from perl -->
      <block start="/((\=|\! \~) |
               [^&lt;\]\}\)\+\-\w\s\/\$] |
               (\bif) | (\bwhen) | (\bunless) | (\bsplit) | (\bor) | grep |^ )
              \s*
              ((?{def:PairStart}\/))
             /x"
        end="/(\/([cmiogxes]*) )/x"
        scheme="regexp:perl.regexp"
        region="String" region01="def:Symbol" region07="regexp:SpecQuote"
        region10="regexp:SpecQuote" region11="def:PairEnd" region12="regexp:SpecArea"/>
      
      <block start="/ (%r\{) /x"
        end="/( \} )/x"
        scheme="regexp:perl.regexp"
        region="String" region00="def:Symbol" region01="def:PairStart"
        region10="def:Symbol" region11="def:PairEnd"/>
      

      <block start='/\%([^\s\w&lt;&gt;])/' end='/\y1/' scheme='def:Comment' region='CommentDoc'/>

      <regexp match='/ (?{Keyword}alias) \s+ (?{AliasOutline}\S+ \s+ \S+)/x'/>
      <regexp match='/\M class \s+ (?{ClassOutline}\S+)/x'/>
      <regexp match='/\M def \s+ (?{MethodOutline}\S+)/x'/>
      

      <block start='/(?{def:PairStart}(?{Keyword}def) \s+ ([^\s\(]+)) (\(.*?\))?/x' end='/\b(?{def:PairEnd}(?{Keyword}end))\b/' scheme='ruby'/>


      <block start='/^\s*(case|class|do|begin|for|while|unless|until|module)\b/' end='/\b(end)\b/' scheme="ruby"
             region00='Keyword' region10='Keyword'
             region01='def:PairStart' region11='def:PairEnd'
             />
      <block start='/^\s*(if)\b/' end='/\b(end)\b/' scheme="ruby"
             region00='Keyword' region10='Keyword'
             region01='def:PairStart' region11='def:PairEnd'
             />
      <block start='/\s*(do)\b/' end='/\b(end)\b/' scheme="ruby"
             region00='Keyword' region10='Keyword'
             region01='def:PairStart' region11='def:PairEnd'
             />

      <inherit scheme="def:PairedBrackets">
        <virtual scheme='def:PairedBrackets' subst-scheme='ruby'/>
      </inherit>

      <inherit scheme='Keywords'/>
    
    </scheme>
    
    <scheme name='Keywords'>
      <regexp match='/ :(?{def:Identifier}[\@\w_]+) /x'/>
      <regexp match='/ (?{def:Identifier}[\@\w_]+):\M[^\:] /x'/>

      <keywords region="Keyword">
        <word name="BEGIN"/>
        <word name="END"/>
        <word name="class"/>
        <word name="ensure"/>
        <word name="nil"/>
        <word name="self"/>
        <word name="when"/>
        <word name="def"/>
        <word name="each"/>
        <word name="false"/>
        <word name="true"/>
        <word name="not"/>
        <word name="super"/>
        <word name="while"/>
        <word name="alias"/>
        <word name="defined"/>
        <word name="for"/>
        <word name="or"/>
        <word name="then"/>
        <word name="yield"/>
        <word name="and"/>
        <word name="do"/>
        <word name="if"/>
        <word name="redo"/>
        <word name="begin"/>
        <word name="else"/>
        <word name="in"/>
        <word name="rescue"/>
        <word name="undef"/>
        <word name="break"/>
        <word name="elsif"/>
        <word name="module"/>
        <word name="retry"/>
        <word name="unless"/>
        <word name="case"/>
        <word name="end"/>
        <word name="new"/>
        <word name="next"/>
        <word name="return"/>
        <word name="until"/>
      </keywords>
      
      <keywords region="def:ClassKeyword">
        &kw-class;
      </keywords>

      <keywords region="def:FunctionKeyword">
        &kw;
      </keywords>

      <keywords region="def:Symbol">
        <symb name='+'/><symb name='-'/><symb name='/'/><symb name='*'/><symb name='='/><symb name='!='/>
        <symb name="."/><symb name=","/>
        <symb name="$'"/>
        <symb name="$/"/>
        <symb name="$`"/>
        <symb name="::"/>
      </keywords>

    </scheme>

  </type>
</hrc>
<!-- ***** BEGIN LICENSE BLOCK *****
   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
   -
   - The contents of this file are subject to the Mozilla Public License Version
   - 1.1 (the "License"); you may not use this file except in compliance with
   - the License. You may obtain a copy of the License at
   - http://www.mozilla.org/MPL/
   -
   - Software distributed under the License is distributed on an "AS IS" basis,
   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   - for the specific language governing rights and limitations under the
   - License.
   -
   - The Original Code is the Colorer Library.
   -
   - The Initial Developer of the Original Code is
   - Igor Russkih <irusskih at gmail dot com>.
   - Portions created by the Initial Developer are Copyright (C) 1999-2005
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -
   - Alternatively, the contents of this file may be used under the terms of
   - either the GNU General Public License Version 2 or later (the "GPL"), or
   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   - in which case the provisions of the GPL or the LGPL are applicable instead
   - of those above. If you wish to allow use of your version of this file only
   - under the terms of either the GPL or the LGPL, and not to allow others to
   - use your version of this file under the terms of the MPL, indicate your
   - decision by deleting the provisions above and replace them with the notice
   - and other provisions required by the LGPL or the GPL. If you do not delete
   - the provisions above, a recipient may use your version of this file under
   - the terms of any one of the MPL, the GPL or the LGPL.
   -
   - ***** END LICENSE BLOCK ***** -->

 	  	 
